Ejemplo n.º 1
0
        private bool SendRequestUseSkillDir(Skill readySkillObj)
        {
            VInt3          vInt = VInt3.one;
            BaseAttackMode currentAttackMode = this.Actor.handle.ActorControl.GetCurrentAttackMode();
            FrameCommand <UseDirectionalSkillCommand> frameCommand = FrameCommandFactory.CreateCSSyncFrameCommand <UseDirectionalSkillCommand>();

            if (currentAttackMode != null)
            {
                vInt = currentAttackMode.SelectSkillDirection(this);
            }
            frameCommand.cmdData.SlotType = this.SlotType;
            if (vInt.x == 0 && vInt.z == 0)
            {
                vInt = this.Actor.handle.forward;
            }
            short degree = (short)((double)(IntMath.atan2(-vInt.z, vInt.x).single * 180f) / 3.1416);

            frameCommand.cmdData.Degree = degree;
            if (!this.skillIndicator.GetSkillBtnDrag())
            {
                frameCommand.cmdData.dwObjectID = this.skillTargetId;
            }
            frameCommand.Send();
            return(true);
        }
Ejemplo n.º 2
0
        public void SendMoveDirection(Vector2 start, Vector2 end)
        {
            this.FixtimeDirSndFrame++;
            VInt3 vInt = this.CalcDirectionByTouchPosition(start, end);

            if (vInt != VInt3.zero)
            {
                int num = (int)((double)(IntMath.atan2(-vInt.z, vInt.x).get_single() * 180f) / 3.1416);
                DebugHelper.Assert(num <32767 && num> -32768, "向量转换成2pi空间超过范围了");
                int num2 = num - this.PreMoveDirection;
                if (num2 > 1 || num2 < -1 || this.FixtimeDirSndFrame > 30)
                {
                    this.SendMoveDirection(num);
                }
            }
        }
Ejemplo n.º 3
0
        public void SendMoveDirection(Vector2 start, Vector2 end)
        {
            this.FixtimeDirSndFrame++;
            VInt3 lhs = this.CalcDirectionByTouchPosition(start, end);

            if (lhs != VInt3.zero)
            {
                int num = (int)((double)(IntMath.atan2(-lhs.z, lhs.x).single * 180f) / 3.1416);
                DebugHelper.Assert(num <32767 && num> -32768, "向量转换成2pi空间超过范围了");
                int num2 = num - this.PreMoveDirection;
                if ((num2 > 1 || num2 < -1 || this.FixtimeDirSndFrame > 30) && (!this.isSlowUpMoveCmd || this.ConfirmDirSndFrame < Time.frameCount - 1))
                {
                    this.SendMoveDirection(num);
                }
            }
        }
Ejemplo n.º 4
0
        public virtual void LookAtDirection(Vector3 dest)
        {
            //if (dest == Vector3.zero)
            //{
            //    return;
            //}
            //VecInt3 inDirection = new VecInt3(dest);
            //m_wrapper.actor.pMoveCtrl.SetRotate(inDirection, true);

            VecInt3 vInt = new VecInt3(dest);

            if (vInt != VecInt3.zero)
            {
                int num = (int)((double)(IntMath.atan2(-vInt.z, vInt.x).single * 180f) / 3.1416);
                DebugHelper.Assert(num <32767 && num> -32768, "WARN: num < 32767 && num > -32768");

                InputModel.instance.SendMoveDirection(num);
                InputModel.instance.SendStopMove(null, false);
            }
        }
Ejemplo n.º 5
0
        public void SendMoveDirection(Vector2 start, Vector2 end)
        {
            this.FixtimeDirSndFrame++;
            VInt3 num = this.CalcDirectionByTouchPosition(start, end);

            if (num != VInt3.zero)
            {
                int moveDegree = (int)(((double)(IntMath.atan2(-num.z, num.x).single * 180f)) / 3.1416);
                DebugHelper.Assert((moveDegree < 0x7fff) && (moveDegree > -32768), "向量转换成2pi空间超过范围了");
                int num3 = moveDegree - this.PreMoveDirection;
                if (((num3 > 1) || (num3 < -1)) || (this.FixtimeDirSndFrame > 30))
                {
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        this.SendMoveDirection(moveDegree, hostPlayer.PlayerId);
                    }
                }
            }
        }