Beispiel #1
0
 public BufConsumer(int InBuffID, PoolObjHandle <ActorRoot> InTargetActor, PoolObjHandle <ActorRoot> inSrcActor)
 {
     this.BuffID      = InBuffID;
     this.TargetActor = InTargetActor;
     this.SrcActor    = inSrcActor;
     this.buffSkill   = null;
 }
Beispiel #2
0
        public override void TriggerLeave(PoolObjHandle <ActorRoot> src, ITrigger inTrigger)
        {
            int leaveUniqueId = this.LeaveUniqueId;

            if (leaveUniqueId > 0)
            {
                BufConsumer bufConsumer = new BufConsumer(leaveUniqueId, src, new PoolObjHandle <ActorRoot>(null));
                bufConsumer.Use();
            }
            int enterUniqueId = this.EnterUniqueId;

            if (this.bStopWhenLeaving && enterUniqueId > 0 && inTrigger != null)
            {
                AreaEventTrigger areaEventTrigger = inTrigger as AreaEventTrigger;
                if (areaEventTrigger != null)
                {
                    RefParamOperator refParamOperator = areaEventTrigger._inActors.get_Item(src.handle.ObjID).refParams[this];
                    if (refParamOperator != null)
                    {
                        ListView <string> listView   = new ListView <string>();
                        GameObject[]      refObjList = this.RefObjList;
                        if (refObjList != null)
                        {
                            int num = refObjList.Length;
                            for (int i = 0; i < num; i++)
                            {
                                listView.Add(string.Format("TriggerActionBuffTar_{0}", i));
                            }
                        }
                        if (this.bSrc)
                        {
                            listView.Add("TriggerActionBuffSrc");
                        }
                        if (this.bAtker)
                        {
                            listView.Add("TriggerActionBuffAtker");
                        }
                        ListView <string> .Enumerator enumerator = listView.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            if (!string.IsNullOrEmpty(current))
                            {
                                BuffFense refParamObject = refParamOperator.GetRefParamObject <BuffFense>(current);
                                if (refParamObject != null)
                                {
                                    refParamObject.Stop();
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public override void TriggerLeave(PoolObjHandle <ActorRoot> src, ITrigger inTrigger)
        {
            int leaveUniqueId = base.LeaveUniqueId;

            if (leaveUniqueId > 0)
            {
                new BufConsumer(leaveUniqueId, src, new PoolObjHandle <ActorRoot>(null)).Use();
            }
            int enterUniqueId = base.EnterUniqueId;

            if ((base.bStopWhenLeaving && (enterUniqueId > 0)) && (inTrigger != null))
            {
                AreaEventTrigger trigger = inTrigger as AreaEventTrigger;
                if (trigger != null)
                {
                    AreaEventTrigger.STriggerContext context = trigger._inActors[src.handle.ObjID];
                    RefParamOperator @operator = context.refParams[this];
                    if (@operator != null)
                    {
                        ListView <string> view       = new ListView <string>();
                        GameObject[]      refObjList = base.RefObjList;
                        if (refObjList != null)
                        {
                            int length = refObjList.Length;
                            for (int i = 0; i < length; i++)
                            {
                                view.Add(string.Format("TriggerActionBuffTar_{0}", i));
                            }
                        }
                        if (base.bSrc)
                        {
                            view.Add("TriggerActionBuffSrc");
                        }
                        if (base.bAtker)
                        {
                            view.Add("TriggerActionBuffAtker");
                        }
                        ListView <string> .Enumerator enumerator = view.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            if (!string.IsNullOrEmpty(current))
                            {
                                BuffFense refParamObject = @operator.GetRefParamObject <BuffFense>(current);
                                if (refParamObject != null)
                                {
                                    refParamObject.Stop();
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #4
0
        public bool Use()
        {
            BuffSkill inBuff = ClassObjPool <BuffSkill> .Get();

            inBuff.Init(this.BuffID);
            if (inBuff.cfgData == null)
            {
                inBuff.Release();
                return(false);
            }
            SkillUseContext context = new SkillUseContext(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.handle.ObjID);

            context.SetOriginator(this.SrcActor);
            if (!inBuff.Use(this.SrcActor, context))
            {
                inBuff.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(inBuff);
            return(true);
        }
Beispiel #5
0
        public bool Use()
        {
            BuffSkill buffSkill = ClassObjPool <BuffSkill> .Get();

            buffSkill.Init(this.BuffID);
            if (buffSkill.cfgData == null)
            {
                buffSkill.Release();
                return(false);
            }
            SkillUseParam skillUseParam = default(SkillUseParam);

            skillUseParam.Init(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.get_handle().ObjID);
            skillUseParam.SetOriginator(this.SrcActor);
            if (!buffSkill.Use(this.SrcActor, ref skillUseParam))
            {
                buffSkill.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(buffSkill);
            return(true);
        }
Beispiel #6
0
        public bool Use()
        {
            BuffSkill buffSkill = ClassObjPool <BuffSkill> .Get();

            buffSkill.Init(this.BuffID);
            if (buffSkill.cfgData == null)
            {
                buffSkill.Release();
                return(false);
            }
            SkillUseParam skillUseParam = default(SkillUseParam);

            skillUseParam.Init(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.handle.ObjID);
            skillUseParam.SetOriginator(this.SrcActor);
            skillUseParam.skillUseFrom = SKILL_USE_FROM_TYPE.SKILL_USE_FROM_TYPE_AREATRIGGER;
            skillUseParam.uiFromId     = (uint)this.BuffID;
            if (!buffSkill.Use(this.SrcActor, ref skillUseParam))
            {
                buffSkill.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(buffSkill);
            return(true);
        }