Exemplo n.º 1
0
        public override void Process(AGE.Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> handle2        = _action.GetActorHandle(0);
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            BuffSkill       skill        = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
            ResDT_SkillFunc outSkillFunc = null;

            if ((skill != null) && skill.FindSkillFunc((int)this.SkillFuncType, out outSkillFunc))
            {
                SSkillFuncContext inContext = new SSkillFuncContext {
                    inTargetObj    = actorHandle,
                    inOriginator   = handle2,
                    inUseContext   = refParamObject,
                    inSkillFunc    = outSkillFunc,
                    inStage        = ESkillFuncStage.Enter,
                    inAction       = new PoolObjHandle <AGE.Action>(_action),
                    inBuffSkill    = new PoolObjHandle <BuffSkill>(skill),
                    inOverlayCount = skill.GetOverlayCount(),
                    inLastEffect   = false
                };
                if (refParamObject != null)
                {
                    inContext.inEffectCount = refParamObject.EffectCount;
                    inContext.inMarkCount   = refParamObject.MarkCount;
                }
                inContext.InitSkillFuncContext();
                skill.SetBuffLevel(inContext.iSkillLevel);
                inContext.LocalParams = new SSkillFuncIntParam[6];
                for (int i = 0; i < 6; i++)
                {
                    inContext.LocalParams[i]        = new SSkillFuncIntParam();
                    inContext.LocalParams[i].iParam = 0;
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning || Singleton <BattleLogic> .GetInstance().isGameOver)
                {
                    return;
                }
                this.m_bSucceeded = Singleton <SkillFuncDelegator> .GetInstance().DoSkillFunc((int)this.SkillFuncType, ref inContext);
            }
            base.Process(_action, _track);
        }
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> actorHandle2   = _action.GetActorHandle(0);
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            BuffSkill       refParamObject2          = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
            ResDT_SkillFunc inSkillFunc = null;

            if (refParamObject2 != null && refParamObject2.FindSkillFunc((int)this.SkillFuncType, out inSkillFunc))
            {
                SSkillFuncContext sSkillFuncContext = default(SSkillFuncContext);
                sSkillFuncContext.inTargetObj    = actorHandle;
                sSkillFuncContext.inOriginator   = actorHandle2;
                sSkillFuncContext.inUseContext   = refParamObject;
                sSkillFuncContext.inSkillFunc    = inSkillFunc;
                sSkillFuncContext.inStage        = ESkillFuncStage.Enter;
                sSkillFuncContext.inAction       = new PoolObjHandle <Action>(_action);
                sSkillFuncContext.inBuffSkill    = new PoolObjHandle <BuffSkill>(refParamObject2);
                sSkillFuncContext.inOverlayCount = refParamObject2.GetOverlayCount();
                sSkillFuncContext.inLastEffect   = false;
                if (refParamObject != null)
                {
                    sSkillFuncContext.inEffectCount = refParamObject.EffectCount;
                    sSkillFuncContext.inEffectCountInSingleTrigger = refParamObject.EffectCountInSingleTrigger;
                    sSkillFuncContext.inMarkCount = refParamObject.MarkCount;
                }
                sSkillFuncContext.InitSkillFuncContext();
                refParamObject2.SetBuffLevel(sSkillFuncContext.iSkillLevel);
                sSkillFuncContext.LocalParams = new SSkillFuncIntParam[8];
                for (int i = 0; i < 8; i++)
                {
                    sSkillFuncContext.LocalParams[i]        = default(SSkillFuncIntParam);
                    sSkillFuncContext.LocalParams[i].iParam = 0;
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning || Singleton <BattleLogic> .GetInstance().isGameOver)
                {
                    return;
                }
                this.m_bSucceeded = Singleton <SkillFuncDelegator> .GetInstance().DoSkillFunc((int)this.SkillFuncType, ref sSkillFuncContext);
            }
            base.Process(_action, _track);
        }