Exemplo n.º 1
0
        public override void HandlerPointerUp(IInteractive interactive, InputData data)
        {
            VPlayer player = VPlayer.instance;

            player.SetTracingTarget(null);

            if (interactive is VBattle)
            {
                Vector3 point;
                if (this.GetGroundHitPoint(out point))
                {
                    if (this._decal != null)
                    {
                        this._decal.markToDestroy = true;
                        this._decal = null;
                    }

                    Effect e = this.owner.battle.CreateEffect("e152");
                    point.y    = 0.02f;
                    e.position = point;

                    this.MovePlayer(point);
                }
            }
            else
            {
                if (interactive is VBio bio && !bio.isDead)
                {
                    if (VEntityUtils.IsAllied(player, bio) &&
                        bio != player &&
                        player.CanMove())
                    {
                        FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.Track, bio.rid));
                    }
                    else
                    {
                        Vector3 position = data.currentRaycast.point;
                        position.y = 0f;
                        Skill skill = player.commonSkill;
                        if (player.CanUseSkill(skill) &&
                            VEntityUtils.CanAttack(player, bio, skill.campType, skill.targetFlag))
                        {
                            player.SetTracingTarget(bio);
                            //普攻
                            FrameActionManager.SetFrameAction(new _DTO_action_info(player.rid, ( byte )FrameActionType.UseSkill, skill.id,
                                                                                   player.rid, bio.rid, position.x, position.y, position.z));
                        }
                        else
                        {
                            UIEvent.SkillUseFailed(player, skill, bio);
                        }
                    }
                }
Exemplo n.º 2
0
        public override void HandlerPointerUp(IInteractive interactive, InputData data)
        {
            bool hitGround = this.GetGroundHitPoint(out Vector3 point);

            if (this._skill.castType == CastType.Point ||
                this._skill.castType == CastType.Dash)
            {
                if (!hitGround)
                {
                    return;
                }

                VPlayer.instance.SetTracingTarget(null);
                if (VPlayer.instance.CanUseSkill(this._skill))
                {
                    FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.UseSkill,
                                                                           this._skill.id,
                                                                           VPlayer.instance.rid, null, point.x, point.y, point.z));
                    this.owner.DropSkill();
                }
            }
            else if (this._skill.castType == CastType.Target)
            {
                if (interactive is VBio entity &&
                    !entity.isDead &&
                    VPlayer.instance.CanUseSkill(this._skill) &&
                    VEntityUtils.CanAttack(VPlayer.instance, entity, this._skill.campType, this._skill.targetFlag))
                {
                    VPlayer.instance.SetTracingTarget(entity);
                    if (VPlayer.instance.CanUseSkill(this._skill))
                    {
                        FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.UseSkill,
                                                                               this._skill.id,
                                                                               VPlayer.instance.rid, entity.rid, 0, 0, 0));
                        this.owner.DropSkill();
                    }
                }
                else
                {
                    //当点击了地面但技能的施放类型不是目标点,则移动角色
                    if (hitGround)
                    {
                        VPlayer.instance.SetTracingTarget(null);
                        this.MovePlayer(point);

                        Effect e = this.owner.battle.CreateEffect("e152");
                        point.y    = 0.02f;
                        e.position = point;
                    }
                }
            }