Ejemplo n.º 1
0
        public void Handle(Contexts contexts, PlayerEntity player, IUserCmd cmd)
        {
            Vector3 to = player.playerIntercept.MovePos;

            if (Vector3.Distance(player.position.Value, to) < 1)
            {
                player.playerIntercept.InterceptType = (int)PlayerActEnum.CmdType.Idle;
                return;
            }

            if (!PlayerInterceptUtil.IsFaceTo(player, to, cmd))
            {
                return;
            }

            AutoMoveUtil.MoveType m = AutoMoveUtil.GetMoveType(player, to);
            switch (m)
            {
            case AutoMoveUtil.MoveType.Walk:
                cmd.MoveVertical = 1;
                break;

            case AutoMoveUtil.MoveType.Jump:
                cmd.MoveVertical = 1;
                cmd.IsJump       = true;
                cmd.IsCrouch     = true;
                break;

            default:
                break;
            }
        }
        public void Handle(Contexts contexts, PlayerEntity player, IUserCmd cmd)
        {
            PlayerEntity target = contexts.player.GetEntityWithEntityKey(new Core.EntityComponent.EntityKey(player.playerIntercept.AttackPlayerId, (short)EEntityType.Player));

            if (target != null)
            {
                if (PlayerInterceptUtil.IsFaceTo(player, target.position.Value, player.userCmd.LastTemp))
                {
                    player.userCmd.LastTemp.IsLeftAttack = true;
                }
            }
        }
Ejemplo n.º 3
0
        public void Handle(Contexts contexts, PlayerEntity player, IUserCmd cmd)
        {
            PlayerEntity target = contexts.player.GetEntityWithEntityKey(new Core.EntityComponent.EntityKey(player.playerIntercept.AttackPlayerId, (short)EEntityType.Player));

            /// DebugUtil.LogInUnity("target.WeaponController():" + target.WeaponController().ToString());
            if (target != null)
            {
                if (PlayerInterceptUtil.IsFaceTo(player, target.position.Value, player.userCmd.Latest))
                {
                    player.userCmd.Latest.IsLeftAttack = true;
                }
            }
        }