Пример #1
0
        public override void Process(Action _action, Track _track)
        {
            if (!MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
            {
                SkillUseContext refParamObject = null;
                Vector3         bindPosOffset  = this.bindPosOffset;
                Quaternion      bindRotOffset  = this.bindRotOffset;
                GameObject      gameObject     = _action.GetGameObject(this.targetId);
                GameObject      obj3           = _action.GetGameObject(this.objectSpaceId);
                Transform       transform      = null;
                Transform       transform2     = null;
                if (this.bindPointName.Length == 0)
                {
                    if (gameObject != null)
                    {
                        transform = gameObject.transform;
                    }
                    else if (obj3 != null)
                    {
                        transform2 = obj3.transform;
                    }
                }
                else
                {
                    Transform transform3 = null;
                    if (gameObject != null)
                    {
                        transform3 = SubObject.FindSubObject(gameObject, this.bindPointName).transform;
                        if (transform3 != null)
                        {
                            transform = transform3;
                        }
                        else if (gameObject != null)
                        {
                            transform = gameObject.transform;
                        }
                    }
                    else if (obj3 != null)
                    {
                        transform3 = SubObject.FindSubObject(obj3, this.bindPointName).transform;
                        if (transform3 != null)
                        {
                            transform2 = transform3;
                        }
                        else if (gameObject != null)
                        {
                            transform2 = obj3.transform;
                        }
                    }
                }
                if (this.bBulletPos)
                {
                    VInt3 zero = VInt3.zero;
                    _action.refParams.GetRefParam("_BulletPos", ref zero);
                    bindPosOffset = (Vector3)zero;
                    bindRotOffset = Quaternion.identity;
                    if (this.bBulletDir)
                    {
                        VInt3 num2 = VInt3.zero;
                        if (_action.refParams.GetRefParam("_BulletDir", ref num2))
                        {
                            bindRotOffset = Quaternion.LookRotation((Vector3)num2);
                        }
                    }
                }
                else if (transform != null)
                {
                    bindPosOffset = transform.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                    bindRotOffset = transform.rotation * this.bindRotOffset;
                }
                else if (transform2 != null)
                {
                    if (obj3 != null)
                    {
                        PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.objectSpaceId);
                        if (actorHandle != 0)
                        {
                            bindPosOffset = (Vector3)IntMath.Transform((VInt3)this.bindPosOffset, actorHandle.handle.forward, (VInt3)obj3.transform.position);
                            bindRotOffset = Quaternion.LookRotation((Vector3)actorHandle.handle.forward) * this.bindRotOffset;
                        }
                    }
                    else
                    {
                        bindPosOffset = transform2.localToWorldMatrix.MultiplyPoint(this.bindPosOffset);
                        bindRotOffset = transform2.rotation * this.bindRotOffset;
                    }
                    if (this.bBulletDir)
                    {
                        VInt3 num3 = VInt3.zero;
                        if (_action.refParams.GetRefParam("_BulletDir", ref num3))
                        {
                            bindRotOffset = Quaternion.LookRotation((Vector3)num3) * this.bindRotOffset;
                        }
                    }
                    else if (this.bBullerPosDir)
                    {
                        refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                        if (refParamObject != null)
                        {
                            PoolObjHandle <ActorRoot> originator = refParamObject.Originator;
                            if ((originator != 0) && (originator.handle.gameObject != null))
                            {
                                Vector3 forward = transform2.position - originator.handle.gameObject.transform.position;
                                bindRotOffset = Quaternion.LookRotation(forward) * this.bindRotOffset;
                            }
                        }
                    }
                }
                if (((!this.bEnableOptCull || (transform2 == null)) || (transform2.gameObject.layer != LayerMask.NameToLayer("Hide"))) && ((!this.bEnableOptCull || !MonoSingleton <GlobalConfig> .instance.bEnableParticleCullOptimize) || MonoSingleton <CameraSystem> .instance.CheckVisiblity(new Bounds(bindPosOffset, new Vector3((float)this.extend, (float)this.extend, (float)this.extend)))))
                {
                    string resourceName;
                    bool   isInit = false;
                    if (this.bUseSkin)
                    {
                        resourceName = SkinResourceHelper.GetResourceName(_action, this.resourceName);
                    }
                    else
                    {
                        resourceName = this.resourceName;
                    }
                    bool flag2       = true;
                    int  particleLOD = GameSettings.ParticleLOD;
                    if (refParamObject == null)
                    {
                        refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                    }
                    if ((refParamObject != null) && (((refParamObject.Originator != 0) && (refParamObject.Originator.handle.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId)) || ((refParamObject.TargetActor != 0) && (refParamObject.TargetActor.handle.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerId))))
                    {
                        flag2 = false;
                    }
                    if (!flag2 && (particleLOD > 1))
                    {
                        GameSettings.ParticleLOD = 1;
                    }
                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;

                    this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(resourceName, true, SceneObjType.ActionRes, bindPosOffset, bindRotOffset, out isInit);

                    MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;

                    if (this.particleObject == null)
                    {
                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = flag2;

                        this.particleObject = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.resourceName, true, SceneObjType.ActionRes, bindPosOffset, bindRotOffset, out isInit);

                        MonoSingleton <SceneMgr> .GetInstance().m_dynamicLOD = false;

                        if (this.particleObject == null)
                        {
                            GameSettings.ParticleLOD = particleLOD;
                            return;
                        }
                    }
                    GameSettings.ParticleLOD = particleLOD;
                    if (this.particleObject != null)
                    {
                        ParticleHelper.IncParticleActiveNumber();
                        if (transform != null)
                        {
                            PoolObjHandle <ActorRoot> handle3 = (transform.gameObject != gameObject) ? ActorHelper.GetActorRoot(transform.gameObject) : _action.GetActorHandle(this.targetId);
                            if ((handle3 != 0) && (handle3.handle.ActorMesh != null))
                            {
                                this.particleObject.transform.parent = handle3.handle.ActorMesh.transform;
                            }
                            else
                            {
                                this.particleObject.transform.parent = transform.parent;
                            }
                        }
                        string layerName = "Particles";
                        if ((transform != null) && (transform.gameObject.layer == LayerMask.NameToLayer("Hide")))
                        {
                            layerName = "Hide";
                        }
                        this.particleObject.SetLayer(layerName);
                        if (isInit)
                        {
                            ParticleHelper.Init(this.particleObject, this.scaling);
                        }
                        if (isInit)
                        {
                            AutoPoolRecycle recycle = this.particleObject.AddComponent <AutoPoolRecycle>();
                            recycle.m_needRecordNumber = true;
                            recycle.lifeTime           = Mathf.Max(((float)_action.length) / 1000f, this.lifeTime);
                        }
                        if (this.applyActionSpeedToParticle && (this.particleObject != null))
                        {
                            _action.AddTempObject(Action.PlaySpeedAffectedType.ePSAT_Fx, this.particleObject);
                        }
                    }
                }
            }
        }
Пример #2
0
 public override void Process(Action _action, Track _track)
 {
     MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.newbiePvPDragonBuff, new uint[0]);
 }
Пример #3
0
 public override bool Check(Action _action, Track _track)
 {
     return(this.done_);
 }
Пример #4
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (!actorHandle)
            {
                return;
            }
            SkillComponent skillControl = actorHandle.get_handle().SkillControl;

            if (skillControl == null)
            {
                return;
            }
            BaseSkill refParamObject = _action.refParams.GetRefParamObject <BaseSkill>("SkillObj");

            if (refParamObject != null)
            {
                List <PoolObjHandle <ActorRoot> > list = this.FilterTargetByTriggerRegion(_action, actorHandle, refParamObject);
                if (list != null && list.get_Count() > 0)
                {
                    SkillChooseTargetEventParam skillChooseTargetEventParam = new SkillChooseTargetEventParam(actorHandle, actorHandle, list.get_Count());
                    Singleton <GameEventSys> .get_instance().SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref skillChooseTargetEventParam);
                }
                SkillUseContext refParamObject2 = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                if (refParamObject2 != null)
                {
                    int num = 0;
                    refParamObject2.EffectCountInSingleTrigger = 1;
                    if (this.bSkillCombineChoose && _action.refParams.GetRefParam("SpecifiedSkillCombineIndex", ref num))
                    {
                        switch (num)
                        {
                        case 1:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_1, false);
                            break;

                        case 2:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_2, false);
                            break;

                        case 3:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_3, false);
                            break;
                        }
                    }
                    else
                    {
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_1, false);
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_2, false);
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_3, false);
                    }
                    if (list != null && list.get_Count() > 0)
                    {
                        for (int i = 0; i < list.get_Count(); i++)
                        {
                            refParamObject2.EffectDir = actorHandle.get_handle().forward;
                            bool flag = skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_1, false);
                            flag |= skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_2, false);
                            flag |= skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_3, false);
                            if (flag)
                            {
                                list.get_Item(i).get_handle().ActorControl.BeAttackHit(actorHandle, refParamObject2.bExposing);
                            }
                        }
                        list.Clear();
                    }
                }
            }
            this.shape = null;
        }
 public override void Leave(Action _action, Track _track)
 {
     this.lastTime = _action.CurrentTime;
     this.TriggerBullet();
     base.Leave(_action, _track);
 }
Пример #6
0
        public override void Enter(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = new PoolObjHandle <ActorRoot>(null);

            this.done_     = false;
            this.lastTime_ = 0;
            base.Enter(_action, _track);
            VInt3 attackerPos = this.attackerPos;

            if (this.attackerId != -1)
            {
                if (_action.GetGameObject(this.attackerId) == null)
                {
                    return;
                }
                actorHandle = _action.GetActorHandle(this.attackerId);
                if (actorHandle == 0)
                {
                    return;
                }
                attackerPos = actorHandle.handle.location;
            }
            this.actor_ = _action.GetActorHandle(this.targetId);
            if (this.actor_ != 0)
            {
                if (!this.actor_.handle.isMovable)
                {
                    this.actor_.Release();
                    this.done_ = true;
                }
                else
                {
                    if (this.dirType == BeatBackDirType.Position)
                    {
                        VInt3 num2 = this.actor_.handle.location - attackerPos;
                        num2.y             = 0;
                        this.moveDirection = num2.NormalizeTo(0x3e8);
                    }
                    else if (this.dirType == BeatBackDirType.Directional)
                    {
                        if (actorHandle == 0)
                        {
                            this.done_ = true;
                            return;
                        }
                        this.moveDirection = actorHandle.handle.forward;
                    }
                    if (this.enableRotate)
                    {
                        this.fromRot = this.actor_.handle.rotation;
                        this.actor_.handle.MovementComponent.SetRotate(-this.moveDirection, true);
                        if (this.rotationTime > 0)
                        {
                            this.toRot = Quaternion.LookRotation((Vector3)this.actor_.handle.forward);
                        }
                        else
                        {
                            this.actor_.handle.rotation = Quaternion.LookRotation((Vector3)this.actor_.handle.forward);
                        }
                    }
                    int initSpeed = this.initSpeed;
                    this.motionControler = new AccelerateMotionControler();
                    if (this.atteDistance > 0)
                    {
                        VInt3 num4 = this.actor_.handle.location - attackerPos;
                        VInt  num5 = num4.magnitude2D;
                        if (num5.i > this.atteDistance)
                        {
                            initSpeed = 0;
                        }
                        else
                        {
                            initSpeed = ((this.atteDistance - num5.i) * this.initSpeed) / this.atteDistance;
                        }
                    }
                    this.motionControler.InitMotionControler(initSpeed, this.accelerateSpeed);
                    this.actor_.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp));
                }
            }
        }
 public override void Process(Action _action, Track _track, int _localTime)
 {
     base.Process(_action, _track, _localTime);
 }
 public override void Enter(Action _action, Track _track)
 {
     base.Enter(_action, _track);
     this.actorObj = _action.GetActorHandle(this.targetId);
     this.lastTime = 0;
 }
Пример #9
0
        public override void Leave(Action _action, Track _track)
        {
            Singleton <CBattleGuideManager> .GetInstance().ResumeGame(this);

            base.Leave(_action, _track);
        }
Пример #10
0
 public override void Enter(Action _action, Track _track)
 {
     base.Enter(_action, _track);
     Singleton <CBattleGuideManager> .GetInstance().PauseGame(this, this.bEffectTimeScale);
 }
Пример #11
0
        public override void Process(AGE.Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (actorHandle != 0)
            {
                SkillComponent skillControl = actorHandle.handle.SkillControl;
                if (skillControl != null)
                {
                    BaseSkill refParamObject = _action.refParams.GetRefParamObject <BaseSkill>("SkillObj");
                    if (refParamObject != null)
                    {
                        List <PoolObjHandle <ActorRoot> > list = this.FilterTargetByTriggerRegion(_action, actorHandle, refParamObject);
                        if ((list != null) && (list.Count > 0))
                        {
                            SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(actorHandle, actorHandle, list.Count);
                            Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref prm);
                        }
                        SkillUseContext inContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                        if (inContext != null)
                        {
                            int num = 0;
                            if (this.bSkillCombineChoose && _action.refParams.GetRefParam("SpecifiedSkillCombineIndex", ref num))
                            {
                                switch (num)
                                {
                                case 1:
                                    skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_1, false);
                                    break;

                                case 2:
                                    skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_2, false);
                                    break;

                                case 3:
                                    skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_3, false);
                                    break;
                                }
                            }
                            else
                            {
                                skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_1, false);
                                skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_2, false);
                                skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_3, false);
                            }
                            if ((list != null) && (list.Count > 0))
                            {
                                for (int i = 0; i < list.Count; i++)
                                {
                                    inContext.EffectDir = actorHandle.handle.forward;
                                    bool flag = false;
                                    flag = skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_1, false) | skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_2, false);
                                    if (flag | skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_3, false))
                                    {
                                        PoolObjHandle <ActorRoot> handle2 = list[i];
                                        handle2.handle.ActorControl.BeAttackHit(actorHandle);
                                    }
                                }
                                list.Clear();
                            }
                        }
                    }
                    this.shape = null;
                }
            }
        }
Пример #12
0
 public override void Leave(Action _action, Track _track)
 {
     this.UnInit();
     base.Leave(_action, _track);
 }
Пример #13
0
 public override void Enter(Action _action, Track _track)
 {
     this.bInit = this.Init(_action);
     base.Enter(_action, _track);
 }