Example #1
0
        private void UpdateTeleportTargetList()
        {
            this.m_CanTeleportActorList.Clear();
            CSkillButtonManager skillButtonManager = Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager;

            SkillSlotType type;

            if (!skillButtonManager.HasMapSlectTargetSkill(out type))
            {
                return;
            }
            SkillSlot skillSlot  = null;
            Player    hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            if (hostPlayer == null || !hostPlayer.Captain)
            {
                return;
            }
            if (!hostPlayer.Captain.get_handle().SkillControl.TryGetSkillSlot(type, out skillSlot))
            {
                return;
            }
            if (!skillSlot.IsEnableSkillSlot())
            {
                return;
            }
            List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .get_instance().GameActors;

            int count = gameActors.get_Count();

            for (int i = 0; i < count; i++)
            {
                PoolObjHandle <ActorRoot> poolObjHandle = gameActors.get_Item(i);
                if (poolObjHandle && !(poolObjHandle == hostPlayer.Captain))
                {
                    ActorRoot handle = poolObjHandle.get_handle();
                    if (!handle.ActorControl.IsDeadState && handle.IsHostCamp() && handle.InCamera)
                    {
                        uint dwSkillTargetFilter = skillSlot.SkillObj.cfgData.dwSkillTargetFilter;
                        if (((ulong)dwSkillTargetFilter & (ulong)(1L << (int)(handle.TheActorMeta.ActorType & (ActorTypeDef)31))) <= 0uL)
                        {
                            this.m_CanTeleportActorList.Add(poolObjHandle);
                        }
                    }
                }
            }
        }
Example #2
0
        public void UseSkillCache(PoolObjHandle <ActorRoot> _actorRoot)
        {
            if (!_actorRoot)
            {
                return;
            }
            if (!this.cacheSkillExpire)
            {
                if (!this.bCacheCommonAttack)
                {
                    SkillSlot skillSlot = _actorRoot.get_handle().SkillControl.GetSkillSlot(this.cacheSkillParam.SlotType);
                    if (skillSlot != null && skillSlot.IsEnableSkillSlot())
                    {
                        this.cacheSkillCommand.frameNum = Singleton <FrameSynchr> .GetInstance().CurFrameNum;

                        _actorRoot.get_handle().ActorControl.CmdUseSkill(this.cacheSkillCommand, ref this.cacheSkillParam);
                    }
                }
                else
                {
                    _actorRoot.get_handle().ActorControl.CacheNoramlAttack(this.cacheSkillCommand, SkillSlotType.SLOT_SKILL_0);
                }
                this.cacheSkillExpire = true;
            }
            if (this.cacheMoveCommand != null && !this.cacheRotateExpire)
            {
                if (this.cacheMoveCommand.cmdType == 131)
                {
                    FrameCommand <MoveDirectionCommand> frameCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
                    if (!_actorRoot.get_handle().ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_MoveRotate))
                    {
                        VInt3 vInt = VInt3.right;
                        vInt = vInt.RotateY((int)frameCommand.cmdData.Degree);
                        _actorRoot.get_handle().MovementComponent.SetRotate(vInt, true);
                        Quaternion rotation = Quaternion.identity;
                        rotation = Quaternion.LookRotation((Vector3)vInt);
                        _actorRoot.get_handle().rotation = rotation;
                    }
                }
                this.cacheRotateExpire = true;
            }
        }
Example #3
0
 public void UseSkillCache(PoolObjHandle <ActorRoot> _actorRoot)
 {
     if (_actorRoot != 0)
     {
         if (!this.cacheSkillExpire)
         {
             if (!this.bCacheCommonAttack)
             {
                 if (this.cacheSkillContext != null)
                 {
                     SkillSlot skillSlot = _actorRoot.handle.SkillControl.GetSkillSlot(this.cacheSkillContext.SlotType);
                     if ((skillSlot != null) && skillSlot.IsEnableSkillSlot())
                     {
                         _actorRoot.handle.ActorControl.CmdUseSkill(this.cacheSkillCommand, this.cacheSkillContext);
                     }
                 }
             }
             else
             {
                 _actorRoot.handle.ActorControl.CacheNoramlAttack(this.cacheSkillCommand, SkillSlotType.SLOT_SKILL_0);
             }
             this.cacheSkillExpire = true;
         }
         if ((this.cacheMoveCommand != null) && !this.cacheRotateExpire)
         {
             if (this.cacheMoveCommand.cmdType == 2)
             {
                 FrameCommand <MoveDirectionCommand> cacheMoveCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand;
                 if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_MoveRotate))
                 {
                     VInt3 inDirection = VInt3.right.RotateY(cacheMoveCommand.cmdData.Degree);
                     _actorRoot.handle.MovementComponent.SetRotate(inDirection, true);
                     Quaternion identity = Quaternion.identity;
                     identity = Quaternion.LookRotation((Vector3)inDirection);
                     _actorRoot.handle.rotation = identity;
                 }
             }
             this.cacheRotateExpire = true;
         }
     }
 }
Example #4
0
        private void RefreshSkillEnableState()
        {
            if (Singleton <CBattleSystem> .GetInstance().FightForm == null)
            {
                return;
            }
            CSkillButtonManager skillButtonManager = Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager;

            SkillSlotType skillSlotType;

            if (!skillButtonManager.HasMapSlectTargetSkill(out skillSlotType))
            {
                return;
            }
            SkillSlot skillSlot  = null;
            Player    hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            if (hostPlayer == null || !hostPlayer.Captain)
            {
                return;
            }
            if (!hostPlayer.Captain.get_handle().SkillControl.TryGetSkillSlot(skillSlotType, out skillSlot))
            {
                return;
            }
            this.m_NeedConfirm = (skillButtonManager.GetSkillJoystickMode(skillSlotType) == enSkillJoystickMode.MapSelectOther);
            if (this.m_TargetSkillEnable != skillSlot.IsEnableSkillSlot())
            {
                this.m_TargetSkillEnable = !this.m_TargetSkillEnable;
                if (this.m_TargetSkillEnable)
                {
                    this.OnPlayerSkillEnable();
                }
                else
                {
                    this.OnPlayerSkillDisable();
                }
            }
        }